
type fn = (a: number, b: number) => number

/*
* infer推导拿到参数类型P返回值类型为Return，再从新返回一个新函数x参数为T，...args参数类型为前面推导保留的P，返回值即Return
* */
type AppendArgument<F extends (...args: any) => any, T> = F extends (...args: infer P) => infer Return ? (x: T, ...args: P) => Return : never

type FinalFn = AppendArgument<fn, string>

const fn: FinalFn = (x: string, a: number, b: number): number => {
	return 1
}
